'use strict';
const {
	main: list
} = require('./data.js')
const db = uniCloud.database();

exports.main = async (event, context) => {
	const {
		data
	} = await db.collection('album_music_db').get()

	data.forEach((current) => {
		let currentLyric = current.lyric
		if (currentLyric.length && currentLyric[0]?.includes('<title>')) {
			current.lyric.shift()
			db.collection('album_music_db').where({
				_id: current._id
			}).update({
				...current,
			})
		}
		

	})

	//返回数据给客户端
	return event
};